import { http } from "@/utils/http";

//登录
export const WebLogin = (data?: object) => {
  return http.request("post", `/api/User/WebLogin`, { data });
};

//初筛
export const pagedDistributorResult = (data?: object) => {
  return http.request("post", `/api/DistributorDevices/pagedDistributorResult`, { data });
};
// 查看推销员库存
export const pagedDistributorDevices = (data?: object) => {
  return http.request("post", `/api/DistributorDevices/pagedDistributorDevices`, { data });
};
// 批量绑定设备
export const bindDistributorDevices = (data?: object) => {
  return http.request("post", `/api/DistributorDevices/bindDistributorDevices`, { data });
};
// 删除设备
export const deleteDistributorDevices = (data?: object) => {
  return http.request("post", `/api/DistributorDevices/deleteDistributorDevices`, { data });
};

// 分页查询推销员以及地址信息
export const pagedDistributorUsers = (data?: object) => {
  return http.request("post", `/api/DistributorUser/pagedDistributorUsers`, { data });
};
// 新增推销员
export const createDistributorUser = (data?: object) => {
  return http.request("post", `/api/DistributorUser/createDistributorUser`, { data });
};
// 修改推销员
export const updateDistributorUser = (data?: object) => {
  return http.request("post", `/api/DistributorUser/updateDistributorUser`, { data });
};
//删除推销员
export const deleteDistributorUser = (id?:any) => {
  return http.request("post", `/api/DistributorUser/deleteDistributorUser?id=${id}`);
};
// 新增推销员地址
export const addDistributorUserAddress = (data?: object) => {
  return http.request("post", `/api/DistributorUser/addDistributorUserAddress`, { data });
};
// 修改推销员地址
export const updateDistributorUserAddress = (data?: object) => {
  return http.request("post", `/api/DistributorUser/updateDistributorUserAddress`, { data });
};
// 删除推销员地址
export const deleteDistributorUserAddress = (data?: object) => {
  return http.request("post", `/api/DistributorUser/deleteDistributorUserAddress`, { data });
};

//上传单个文件
export const UploadSingleFile = (data?: object) => {
  return http.request("post", `/api/File/UploadSingleFile`, { data });
};
